#!/bin/sh

PATH=$PATH:/home/oracle/scripts ; export PATH
LOG=/tmp/startdb.log
MSG_LOG=/oracle/newbackup/log/joblog_`date +%Y%m`.log ;export MSG_LOG
JOBNAME=Start_DB          ; export JOBNAME

MSG_JOB S

sqlplus /nolog << EOF
connect / as sysdba
startup
exit
EOF
RC=$?
if [[ $RC != 0 ]]
then
  MSG_JOB E "DB Start Failed"
  exit 1
else
  MSG_JOB I "Start Database Successfully"
fi
sleep 10

lsnrctl start
RC=$?
if [[ $RC != 0 ]]
then
  MSG_JOB E "Listener Start Failed"
  exit 1
else
  MSG_JOB I "Start Listener Successfully"
fi
sleep 10
MSG_JOB N
